colors= "6 e 9 a b" /* Defines color of Lexicon Chart. See README! File */
uselex= "31" /* Access Groups that will NOT use Lexicon. ""=ALL */
parse arg asklex;gu 1302307;file=result;if file="?" then signal HELP;gu 2307386;df=result;gu 15;if index(' 'uselex' ',' 'result' ')>0&file="" then exit
if asklex=0 then do;se 'cdLEX c6Check cbMessagec6? c7[caNoc7]c6: ca';gc;a=result;if a~='Y' then do;tr 'No.';exit;end;else tr 'Yes!';end
gu 1;handle=result;gu 23;port=result;if (file=""|(~open(f1,file)&upper(file)~="UPLOAD"))&~exists(df'_edbuff'port) then exit
parse var colors c1' 'c2' 'c3' 'c4' 'c5;if upper(file)="UPLOAD" then do;setprotocol "X";file=df'LexFile';XUP file;end
if file>'' then loadeditor file;se 'cbAnalyzing cdMessagec6...';call open(f1,df'_edbuff'port,'r');call open(f2,df'unquote'port,'w')
do i=1 until eof(f1);line=readln(f1);a=index(line,'>');if (a=0 | a>5) & eof(f1)=0 then call writeln(f2,line);end;call close(f2);call close(f1);totlines=i-1
address command 'c:lex 'df'unquote'port' >'df'lexcheck'port;call open(f1,df'lexcheck'port,'r');do 3;j=readln(f1);end;do i=1 to 12;l.i=readln(f1);end i
tr 'c'c1'Analyzedc'c3': c'c4||v1.1'c'c1' out of c'c4||totlines'c'c1' Total Lines.n1';tr 'c'c2' Number of Words Analyzedc'c3': c'c5||v2.1
tr 'c'c1' Long Words(3+ Syllables)c'c3': c'c4||v3.1;tr 'c'c2' Your Average Word Lengthc'c3': c'c5||v4.1' c'c2'Syllables.'
tr 'c'c1' Total Number of Sentencesc'c3': c'c4||v5.1;tr 'c'c2' Average Words Per Sentencec'c3': c'c5||v5.2'n1'
tr 'c'c1'The Gunning-Fog Index Valuec'c3': c'c4||v6.1;tr 'c'c2' The Flesch Index Valuec'c3': c'c5||v7.1;tr 'c'c1' The Flesch Grade Levelc'c3': c'c4||v7.2
tr 'c'c2' The Kincaid Index Valuec'c3': c'c5||v8.1'n1';tr 'c'c1' Could Be Understood Byc'c3': c'c4||l.12'n1';se ' c'c3'<c'c1'Tap c'c4'ENTER c'c1'Nowc'c3'>i1';exit